<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import {useStore} from 'vuex'

const store = useStore()
onLaunch(() => {
  uni.getStorage({
	  key:'uinfo',
	  success: (res) => {
	  	console.log('本地存储用户信息',res);
		store.commit('user/init',res.data)
	  }
  })
  
  //判断用户是否首次安装应用
  uni.getStorage({
	  key:'first',
	  fail: () => {
	  	uni.redirectTo({
	  		url:'/pages/welcome/welcome'
	  	})
	  }
  })
});
onShow(() => {
  console.log("App Show");
});
onHide(() => {
  console.log("App Hide");
});
</script>
<style >
@import 'colorui/icon.css';
@import 'colorui/animation.css';
@import 'colorui/main.css';
@import 'static/font/iconfont.css'
</style>
